Clean up Cargo's util::errors module
authorAlex Crichton <alex@alexcrichton.com>
Sun, 21 Dec 2014 23:19:44 +0000 (15:19 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 30 Dec 2014 02:59:15 +0000 (18:59 -0800)
commit9ed3a6ea1dc4dfe46ffbb1218cafce61a64f9ff9
tree886e111a5739943b25c73dadbe765a0b99bdbc54
parentbc2ddbb91274ff9be9c1868f9f690ed74f41fe33
Clean up Cargo's util::errors module

This commit cleans up cargo's error module to reduce the duplication of
`CargoError` and the standard library's `Error` trait. The `CargoError` trait
remains, but only has one methods, `is_human`.

A number of other modifications were made:

* ChainError was altered to work over unboxed closures
* Wrap and Require were removed as they're duplicates of the ChainError
  functionality.
* Many public error types are now private from util::errors as they're only
  returned as boxed trait objects.
* The `concrete` was removed, all calls to `make_human` are now done through a
  newtype `Human` wrapper.
* Cargo's custom `try!` macro was removed.
39 files changed:
src/bin/bench.rs
src/bin/locate_project.rs
src/bin/test.rs
src/cargo/core/package_id.rs
src/cargo/core/package_id_spec.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/encode.rs
src/cargo/lib.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_package.rs
src/cargo/ops/cargo_run.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/registry.rs
src/cargo/util/config.rs
src/cargo/util/errors.rs
src/cargo/util/mod.rs
src/cargo/util/process_builder.rs
src/cargo/util/result.rs [deleted file]
src/cargo/util/toml.rs
tests/support/mod.rs
tests/support/registry.rs
tests/test_cargo.rs
tests/test_cargo_bench.rs
tests/test_cargo_build_auth.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs
tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_path_deps.rs
tests/test_cargo_freshness.rs
tests/test_cargo_generate_lockfile.rs
tests/test_cargo_new.rs
tests/test_cargo_package.rs
tests/test_cargo_publish.rs
tests/test_cargo_search.rs
tests/test_cargo_test.rs
tests/test_shell.rs